import React, { Component } from 'react';
import {
    TouchableOpacity,
    Text,
    Image,
    View
} from 'react-native';
import Style from './Style.js';

export default class InputButton extends Component {
    render() {
        if (this.props.image == null) {
            return (
                <TouchableOpacity onPress={this.props.onPress}>
                    <View style={Style.inputItemContainer}>
                        <Text style={Style.inputItemText}>{this.props.value}</Text>
                    </View>
                </TouchableOpacity>
            );
        } else {
            return (
                <TouchableOpacity onPress={this.props.onPress}>
                    <View style={Style.inputItemContainer}>
                        <Image source={this.props.image} style={Style.inputItemImage}/>
                    </View>
                </TouchableOpacity>
            );
        }
    }
}